﻿<Window x:Class="Demos.Sorting.Quicksort.View"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Quicksort" Height="450" Width="800" ResizeMode="CanMinimize">
    <Grid Margin="0,5,0,5">
        <Grid.RowDefinitions>
            <RowDefinition Height="100"></RowDefinition>
            <RowDefinition></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>
        
        <ItemsControl ItemsSource="{Binding Baraja, UpdateSourceTrigger=PropertyChanged, Mode=OneWay}">
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <Canvas></Canvas>
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
        </ItemsControl>
        
        <Border Grid.Row="1" BorderBrush="DarkGray" BorderThickness="1" Margin="10">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition></RowDefinition>
                    <RowDefinition></RowDefinition>
                </Grid.RowDefinitions>
                
                <StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Center">
                    <GroupBox Header="Basic" Width="175" Margin="10" Name="basicGB">
                        <Label Content="{Binding Resultados[0]}"></Label>
                    </GroupBox>
                    <GroupBox Header="In Place" Width="175" Margin="10" Name="ipGB">
                        <Label Content="{Binding Resultados[1]}"></Label>
                    </GroupBox>
                    <GroupBox Header="Basic In Place" Width="175" Margin="10" Name="bipGB">
                        <Label Content="{Binding Resultados[2]}"></Label>
                    </GroupBox>
                    <GroupBox Header="Randomized In Place" Width="175" Margin="10" Name="ripGB">
                        <Label Content="{Binding Resultados[3]}"></Label>
                    </GroupBox>
                </StackPanel>

                <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
                    <GroupBox Header="Basic SemiIterative In Place" Width="175" Margin="10" Name="bsipGB">
                        <Label Content="{Binding Resultados[4]}"></Label>
                    </GroupBox>
                    <GroupBox Header="SemiIterative In Place 1" Width="175" Margin="10" Name="sipGB">
                        <Label Content="{Binding Resultados[5]}"></Label>
                    </GroupBox>
                    <GroupBox Header="SemiIterative In Place 2" Width="175" Margin="10" Name="sip1GB">
                        <Label Content="{Binding Resultados[6]}"></Label>
                    </GroupBox>
                    <GroupBox Header="Randomized SemiIterative IP" Width="175" Margin="10" Name="rsipGB">
                        <Label Content="{Binding Resultados[7]}"></Label>
                    </GroupBox>
                </StackPanel>
            </Grid>
        </Border>
        
        <Grid Grid.Row="2" HorizontalAlignment="Center">
            <Grid.ColumnDefinitions>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
            </Grid.ColumnDefinitions>

            <GroupBox Grid.Column="0" Header="Baraja" Padding="5">
                <StackPanel>
                    <Button Margin="5" Name="OrdenarBtn" Command="{Binding OrdenarCommand}">Ordenar</Button>
                    <Button Margin=" 5" Name="DesordenarBtn" Command="{Binding DesordenarCommand}">Desordenar</Button>
                </StackPanel>
            </GroupBox>
            
            <GroupBox Grid.Column="1" Header="Tiempos" Padding="5">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition></RowDefinition>
                        <RowDefinition></RowDefinition>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition></ColumnDefinition>
                        <ColumnDefinition></ColumnDefinition>
                        <ColumnDefinition></ColumnDefinition>
                        <ColumnDefinition></ColumnDefinition>
                        <ColumnDefinition></ColumnDefinition>
                        <ColumnDefinition></ColumnDefinition>
                    </Grid.ColumnDefinitions>

                    <Label Grid.Row="0" Grid.Column="0" Margin="5">Talla:</Label>
                    <TextBox Grid.Row="0" Grid.Column="1" Name="tallaTxt" Width="60" Margin="5"
                             Text="{Binding TallaView, UpdateSourceTrigger=PropertyChanged}">
                    </TextBox>
                    <Button Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Margin="5" Name="comenzarBtn" 
                             Command="{Binding ExperimentarCommand}">Comenzar
                    </Button>

                    <CheckBox Grid.Row="0" Grid.Column="2" Margin="5" Name="BChk" 
                              IsChecked="{Binding OpcionAlgoritmo[0]}">Basic
                    </CheckBox>
                    <CheckBox Grid.Row="0" Grid.Column="3" Margin="5" Name="IPChk"
                              IsChecked="{Binding OpcionAlgoritmo[1]}">In Place
                    </CheckBox>
                    <CheckBox Grid.Row="0" Grid.Column="4" Margin="5" Name="BIPChk"
                              IsChecked="{Binding OpcionAlgoritmo[2]}">Basic IP
                    </CheckBox>
                    <CheckBox Grid.Row="0" Grid.Column="5" Margin="5" Name="RIPChk"
                              IsChecked="{Binding OpcionAlgoritmo[3]}">Randomized IP
                    </CheckBox>

                    <CheckBox Grid.Row="1" Grid.Column="2" Margin="5" Name="BSIPChk"
                              IsChecked="{Binding OpcionAlgoritmo[4]}">B SemiIterative IP
                    </CheckBox>
                    <CheckBox Grid.Row="1" Grid.Column="3" Margin="5" Name="SIP1Chk"
                              IsChecked="{Binding OpcionAlgoritmo[5]}">SemiIterative IP 1
                    </CheckBox>
                    <CheckBox Grid.Row="1" Grid.Column="4" Margin="5" Name="SIP2Chk"
                              IsChecked="{Binding OpcionAlgoritmo[6]}">SemiIterative IP 2
                    </CheckBox>
                    <CheckBox Grid.Row="1" Grid.Column="5" Margin="5" Name="RSIPChk"
                              IsChecked="{Binding OpcionAlgoritmo[7]}">R SemiIterative IP
                    </CheckBox>
                </Grid>
            </GroupBox>
        </Grid>
    </Grid>
</Window>
